<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>倒计时</title>
</head>
<style type="text/css">

	.time{
		width: 520px;
		height: 250px;
		background: black url() 0 0 no-repeat;
	}
	.title{
		color: #fff;
		text-align: center;
		border-bottom:3px solid #A4FF46;
	}
	.bg{
		display: block;
		float: left;
		color: #fff;
		font-size: 55px;
		height: 78px;
		width: 78px;
		background: #414141 url() 0 0 no-repeat;
		border: 10px solid #252525;
		margin-left: 25px;
		margin-top: 20px;
		text-align: center;
		line-height: 78px;
		position: relative;top: 0px;left: 0px;
	}
</style>
<body>
	<div class="time">
		<h1 class="title">距离国庆假日x还有</h1>
		<span class="bg" id="day">00</span>
		<span class="bg" id="shi">00</span>
		<span class="bg" id="fen">00</span>
		<span class="bg" id="miao">00</span>
	</div>
</body>
<script type="text/javascript">
	function GeiRTime () {
		NowTime = new Date();
		EndTime = new Date("2017-10-1");
		var t = EndTime.getTime() - NowTime.getTime();
		var d=0;
		var h=0;
		var m=0;
		var s=0;
		if (t>=0) {
			d = Math.floor(t/1000/24/60/60);
			h = Math.floor(t/1000/60%24);
			m = Math.floor(t/1000/60%60);
			s = Math.floor(t/1000%60);
		};
		document.getElementById("day").innerHTML = d ;
		document.getElementById("shi").innerHTML = h ;
		document.getElementById("fen").innerHTML = m ;
		document.getElementById("miao").innerHTML = s ;
	}

	setInterval("GeiRTime()",1000)

</script>
</html>